#pragma once
#include "Vector3.h"
#include "Texture.h"
#include "MsgBoard.h"
#include <vector>

class MessageBoard;
class CUnit
{
private:
	int id;
	int team;
	int health;
	int maxHealth;
	int damage;
	int detRadius;
	int atkRadius;
	int size;
	float speed;
	float atkrate;
	bool active;
	bool toggle;
	Vector3D pos;
	Vector3D color;
	MessageBoard* CurrentMsg;
	
public:
	CUnit();
	~CUnit();

	MessageBoard *mb;

	int GetID(void);
	int GetTeam(void);
	int GetHealth(void);
	int GetMaxHealth(void);
	int GetDamage(void);
	int GetDetRadius(void);
	int GetAtkRadius(void);
	int GetSize(void);
	float GetSpeed(void);
	float GetAttackRate(void);
	bool GetActive(void);
	bool GetToggle(void);
	Vector3D GetPos(void);
	Vector3D GetColor(void);
	std::string RcvMessage(MessageBoard *mb);
	std::string MsgFrom(MessageBoard *mb);
	std::string MsgTo(MessageBoard *mb);
	MessageBoard* GetCurrentMsg(void){return CurrentMsg;};
	void SetMessage(MessageBoard* message){CurrentMsg = message;}
	virtual void CheckMessage(std::vector<MessageBoard*> &Msgb);

	void SetID(int id);
	void SetTeam(int team);
	void SetHealth(int health);
	void SetMaxHealth(int maxHealth);
	void SetDamage(int damage);
	void SetDetRadius(int detRadius);
	void SetAtkRadius(int atkRadius);
	void SetSize(int size);
	void SetSpeed(float speed);
	void SetAttackRate(float atkrate);
	void SetActive(bool active);
	void SetToggle(bool toggle);
	void SetPos(Vector3D pos);
	void SetColor(Vector3D color);
	void SetMessage(MessageBoard *mb, std::string from, std::string to, std::string msg);

	void RenderHealthBar(void);
	bool LoadTGA(Texture *texture, char *filename);

	virtual void Render(void) = 0;
	virtual void Update(float) = 0;
	virtual void UnitInteraction(CUnit*) = 0;
	virtual void PrintState(int, int, float, float, float, char*) = 0;
	virtual void DealDamageTo(CUnit*) = 0;
};


